package com.dy.lock.screen.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.CustomerLikeDao;
import com.dy.lock.screen.pojo.CustomerLikeInfo;
import com.dy.lock.screen.service.CustomerLikeService;
import com.dy.lock.screen.vo.CommonCommentLikeVo;

@Service("customerLikeService")
public class CustomerLikeServiceImpl implements CustomerLikeService {

	@Resource(name = "customerLikeDao")
	private CustomerLikeDao customerLikeDao;

	@Override
	public CustomerLikeInfo queryByPrimaryKey(String id) {
		return this.customerLikeDao.queryByPrimaryKey(id);

	}

	@Override
	public Integer queryCount(Map<String, Object> para) {
		return this.customerLikeDao.queryCount(para);
	}

	@Override
	public String save(CustomerLikeInfo likeInfo) {
		likeInfo.setId(UUID.randomUUID().toString());
		likeInfo.setLikeTime(new Date());
		int re = this.customerLikeDao.insert(likeInfo);
		if (re > 0) {
			return likeInfo.getId();
		} else {
			return "";
		}
	}

	@Override
	public int delete(CustomerLikeInfo likeInfo) {
		int re = this.customerLikeDao.delete(likeInfo);
		return re;
	}

	@Override
	public CustomerLikeInfo queryByMidAndCid(CustomerLikeInfo likeInfo) {
		return this.customerLikeDao.queryByMidAndCid(likeInfo);
	}

	@Override
	public List<CustomerLikeInfo> queryPage(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.customerLikeDao.queryT(para);
	}

	@Override
	public CommonCommentLikeVo queryDetailByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return this.customerLikeDao.queryDetailByPrimaryKey(id);
	}

}
